<?php

namespace Xin\ChatGPT;

use Xin\Support\Contracts\Arrayable;

class CompletionMessage implements Arrayable
{
    /**
     * @var string
     */
    public $role;

    /**
     * @var string
     */
    public $content;

    /**
     * @param string $role
     * @param string $content
     */
    public function __construct(string $content, string $role = 'user')
    {
        $this->role = $role;
        $this->content = $content;
    }


    public function toArray()
    {
        return [
            'role' => $this->role,
            'content' => $this->content,
        ];
    }
}
